Wish List
Note: Spartacus 3.x is no longer maintained. Please upgrade to the latest version.
Note: Spartacus 3.x was tested with SAP Commerce Cloud versions 1905 to 2105. Spartacus 3.x has not been verified to work with (and is not guaranteed to work with) SAP Commerce Cloud 2211 or later releases.
Note: This feature is introduced with version 1.4 of the Spartacus libraries.
The Wish List feature lets you save products for later viewing.
Usage
You can add products to a wish list from the product details page. If you are not signed in, the “Add to Wish List” option will indicate that you need to be logged in before you can add a product to the wish list.
Once you have added items to the wish list, you can view the contents of your wish list through the Wish list option in the My Account menu.
Customizing
The wish list feature consists of the AddToWishListComponent and the WishListService component. Both of these components are CMS driven and can be configured in SmartEdit. You can also customize these components in Spartacus using CMS component mapping. For more information, see Customizing CMS Components.
Limitations
A user cannot have more than one wish list. Furthermore, each wish list is tied to a specific user, so a wish list cannot be shared with other users. Finally, it is not possible to add a product to a wish list if that product is out of stock.
Disabling Wish Lists
The wish list feature is enabled by default in Spartacus.
The only way to disable wish lists is through the CMS. You can disable wish lists by making changes to the spartacussampledata extension, or to your custom AddOn, as follows:
-
Remove the
WishListLinkby removing the following line from the relevantcms-responsive-content.impexfiles:;;WishListLink;Wish List Link;/my-account/wishlist;WishListLink;WishListLink;;loggedInUserNote: There is a
cms-responsive-content.impexfile for each base site. -
Remove the link from the
SiteLinksSlotby removingWishListLinkfrom the following line in the relevantcms-responsive-content.impexfiles:;;SiteLinksSlot;Slot contains some links;true;OrdersLink,WishListLink,StoreFinderLink,ContactUsLink,HelpLink -
Remove the
WishListNavNodeby removing the following line from the relevantcms-responsive-content.impexfiles:;WishListNavNode;;Wish List;MyAccountNavNode;;WishListNavNode -
Remove the
WishListNavNodeEntryby removing the following line from the relevantcms-responsive-content.impexfiles:;WishListNavNodeEntry;;WishListNavNodeEntry;WishListNavNode;WishListLink; -
Remove all references of
WishListPage,BodyContentSlot-wishList,WishListComponentandAddToWishListComponent.
You can also do these steps in Backoffice.